package dd.prog2.musterExercises.ws12set07_tanks;

/**
 * Represents a basic tank, which is defined by a radius.
 * 
 * @author Ruediger Lunde
 */
public class SphericalTank extends BasicTank {
	private double radius;

	public SphericalTank(double r) {
		radius = r;
	}
	
	@Override
	public double getSurface() {
		return 4.0 * Math.PI * radius * radius;
	}

	@Override
	public double getVolume() {
		return 4.0 / 3.0 * Math.PI * radius * radius * radius;
	}

	@Override
	public String toString() {
		return "SphericalTank(radius=" + radius + ")";
	}
}
